#pragma once
#include <QVector>
#include <random>

enum class ShuffleMode { NearlySorted, Reverse, Random };

inline void applyShuffle(QVector<uint32_t> &v, ShuffleMode m) {
    int N = v.size();
    switch (m) {
        case ShuffleMode::NearlySorted:
            for (int i = 0; i < N; i++) v[i] = i + (i % 10 == 0 ? 5 : 0);
            break;
        case ShuffleMode::Reverse:
            for (int i = 0; i < N; i++) v[i] = N - 1 - i;
            break;
        case ShuffleMode::Random:
        default: {
            std::mt19937 rng(std::random_device{}());
            std::iota(v.begin(), v.end(), 0);
            std::shuffle(v.begin(), v.end(), rng);
        }
    }
}
